package com.lin.cloud.disk.service;

import com.lin.cloud.disk.entity.pojo.DirectoryClosure;
import com.lin.cloud.disk.entity.request.directory.*;

import java.util.List;

/**
 * (DirectoryClosure)表服务接口
 *
 * @author ljc
 * @since 2020-12-30 21:53:41
 */
public interface IDirectoryClosureService {

    /**
     * 创建目录闭包表
     * @param directoryClosureList
     */
    void createDirectoryClosureList(List<DirectoryClosure> directoryClosureList);

    /**
     * 获取祖先节点列表
     * @param request 子孙节点
     * @return
     */
    List<DirectoryClosure> getAncestorList(GetAncestorListRequest request);


    /**
     * 获取根目录列表
     * @param request request
     * @return
     */
    List<DirectoryClosure> getRootDirectoryList(GetRootDirectoryListRequest request);

    /**
     * 物理删除闭包表数据
     * @param request
     * @return
     */
    int physicistRemoveDirectoryClosure(RemoveDirectoryRequest request);

    /**
     * 获取子孙闭表列表数据 包括自己
     * @param request
     * @return
     */
    List<DirectoryClosure> getDescendantListAndMeByIdList(GetDescendantListAndMeByIdListRequest request);

    /**
     * 物理移动删除闭包表数据
     * @param moveRemoveDirectoryRequest
     * @return
     */
    int physicistMoveRemoveDirectoryClosure(MoveRemoveDirectoryRequest moveRemoveDirectoryRequest);

    /**
     * 获取下一级目录列表
     * @param request
     * @return
     */
    List<DirectoryClosure> getNextLevelDirectoryList(GetNextLevelDirectoryListRequest request);

    /**
     * 删除祖先等于子孙的边
     * @param request
     * @return
     */
    void removeAncestorEqDescendant(RemoveAncestorEqDescendantRequest request);

    /**
     * 批量更新
     * @param list
     */
    void batchUpdateDirectoryClosure(List<DirectoryClosure> list);

    /**
     * 批量删除
     * @param idList
     */
    void batchRemoveDirectoryClosure(List idList);
}